#include "ThreadPool.hpp"
#include <iostream>
#include <unistd.h>
using namespace std;

void fun()
{
    ThreadPool<Task>* pthreadpool = ThreadPool<Task>::GetInstance(5);
    pthreadpool->run();
    int x = 0, y = 0;
    char op;
    int cnt = 1;
    while(cnt)
    {
        cout << "请输入数据1# ";
        cin >> x;
        cout << "请输入数据2# ";
        cin >> y;
        cout << "请输入操作选项# ";
        cin >> op;
        Task t(x,y,op);
        //threadpool->push(t);
        pthreadpool->push(t);
        sleep(1);
        cnt--;
    }

    delete pthreadpool;
}

int main()
{
    // ThreadPool<Task>* threadpool = new ThreadPool<Task>();
    //threadpool->run();

    
    //pthreadpool->DelInstance();
    fun();

    sleep(2);
    return 0;
}